<template>
    <div class="wrapper">
        <div class='top'>
            <img src="../../assets/zfcg.svg">
            <p>支付成功!</p>
        </div>
        <div class="bottom">
            <van-cell title="订单号" :value="this.order_code" />
            <van-cell title="支付金额" :value="'￥' + this.total" />
        </div>
    </div>
</template>

<script>
    export default {
        name: 'PayComplete',
        mounted() {
            //console.log(this.$store.state.payOrder)
            this.sendcode()
            
        },
    
        data() {
            return {
                order_code: this.$store.state.payOrder.order_code,
                total: this.$store.state.payOrder.subtotal?this.$store.state.payOrder.subtotal:'0'
            }
        },
        methods:{
            //发送用户通知消息i
            async sendcode(){
                let formData = new FormData()
                formData.append('openid', this.$store.state.openid)
                formData.append('order', this.order_code)
                formData.append('price', this.total)
                let { data: { code, data } } = await this.$http.post(this.$api.sendSendcode,formData)
            }
        }
    }
</script>

<style lang="scss" scoped>
  .wrapper {
    background: #eee;
    height: 100vh;
  }
  .top {
    width: 100%;
    height: 10rem;
    text-align: center;
    overflow: hidden;
    background: #fff;
    img {
      display: block;
      margin: 1rem auto 0.4rem;
      width: 5rem;
    }
    p {
      font-size: 14px;
    }
  }
  .bottom {
    margin-top: 0.2rem;
    background: #fff;
  }
</style>
